package com.njlime.cms.service.sys;
 
import com.njlime.cms.entities.MaterialsNewsGroup;
import com.njlime.cms.repository.sys.MaterialImageGroupDao;
import com.njlime.cms.repository.sys.MaterialNewsGroupDao;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * Created by Dean on 2017-7-27.
 */
@Service
@Transactional(readOnly = true)
public class MaterialNewsGroupService {

    @Resource
    private MaterialNewsGroupDao materialNewsGroupDao;


    public List<MaterialsNewsGroup> list(int unitId    ) {
        return materialNewsGroupDao.list(  unitId );
    }


    @Transactional(readOnly = false)
    public void add(MaterialsNewsGroup info) {
        materialNewsGroupDao.save(info);
    }

    public Map getSumMember(int unitId) {
        return materialNewsGroupDao.getSumMember(unitId);
    }

    @Transactional(readOnly = false)
    public void edit(MaterialsNewsGroup info) {
      //  materialImageGroupDao.edit(info);
    }
}
